import url from '@/tool/index.js'
export const orderList = (status='',page=1) => { //订单列表
	return new Promise(resolve => {
		uni.request({
			url: url+'/api/coachcenter.order/coachOrderLists',
			data: {
				status:status,
				page:page,
				coachtoken:uni.getStorageSync('teacherToken')
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}
//订单详情
export const orderDetail = (orderid) => { //
	return new Promise(resolve => {
		uni.request({
			url: url+'/api/coachcenter.order/coachOrderDetail',
			data: {
				orderid:orderid,
				coachtoken:uni.getStorageSync('teacherToken')
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}
export const QRcode = (orderid) => { //扫一扫
	return new Promise(resolve => {
		uni.request({
			url: url+'/api/coachcenter.order/wxaccessToken',
			data: {
				coachtoken:uni.getStorageSync('teacherToken'),
			},
			header:{
				'Content-Type':'application/x-www-form-urlencoded'
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}
export const hexiao = (ordernumber) => { //扫一扫
	return new Promise(resolve => {
		uni.request({
			url: url+'/api/coachcenter.order/hexiao',
			data: {
				ordernumber:ordernumber,
				coachtoken:uni.getStorageSync('teacherToken')
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}
export const endtiming = (ordernumber) => { //订单结束计时
	return new Promise(resolve => {
		uni.request({
			url: url+'/api/coachcenter.order/endtiming',
			data: {
				ordernumber:ordernumber,
				coachtoken:uni.getStorageSync('teacherToken')
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}
export const studyweidao = (ordernumber) => { //学员未到
	return new Promise(resolve => {
		uni.request({
			url: url+'/api/coachcenter.order/studyweidao',
			data: {
				ordernumber:ordernumber,
				coachtoken:uni.getStorageSync('teacherToken')
			},
			method: 'POST',
			success: (res) => resolve(res.data),
		});
	})
}